package alipushclient

import (
	"time"
)

type PublicParameters struct {
	Format           string
	RegionId         string
	Version          string
	AccessKeyId      string
	SignatureMethod  string
	Timestamp        string
	SignatureVersion string
	SignatureNonce   string
}

func (p *PublicParameters) SetPublicParameters(region, accessKeyId string) {
	p.Format = "JSON"
	p.RegionId = region
	p.Version = "2015-08-27"
	p.AccessKeyId = accessKeyId
	p.SignatureMethod = "HMAC-SHA1"
	p.Timestamp = time.Now().UTC().Format("2006-01-02T03:04:05Z")
	p.SignatureVersion = "1.0"

	id, _ := NewV4()
	p.SignatureNonce = id.String()
}
